package com.yueyang.sojourn.server.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author andy.yang
 * @summary 分账方同步配置到第三方（微信）的同步状态 枚举
 * @Copyright (c) 2020, Yueyang Group All Rights Reserved.
 * @since 2020-02-13
 */
@AllArgsConstructor
public enum ProjectShareThirdSynStatusEnum implements IEnum {
    /**
     * 订单状态 枚举
     */
    NO_NEED(0, "不需要"),
    TO_SYN(1, "待同步"),
    SYNED(2, "已同步")
    ;

    @Getter
    private int code;

    @Getter
    private String desc;

    public static ProjectShareThirdSynStatusEnum ofCode(Integer code) {
        return Arrays.stream(ProjectShareThirdSynStatusEnum.values()).filter(operStatusEnum -> operStatusEnum.code == code).findFirst().orElse(null);
    }
}
